package com.kaifamiao.calendar;

import java.util.Locale;

public class LocaleInstance {

    public static void main(String[] args) {

        Locale x = Locale.getDefault();
        System.out.println( x );

        // 可以使用 指定的 语言 和 国家/地区 来创建 Locale实例
        Locale de = new Locale( "de", "DE" );
        System.out.println( de );

        Locale us = new Locale( "en", "US" );
        System.out.println( us );

        System.out.println( "- ".repeat( 10 ) );

        Locale[] locales = Locale.getAvailableLocales();
        for (int i = 0; i < locales.length; i++) {
            Locale e = locales[i];
            System.out.println( "默认的: " + e.getDisplayName() );
            System.out.println( "德国的: " + e.getDisplayName( de ) );
            System.out.println( "美国的: " + e.getDisplayName( us ) );
            System.out.println( "\t- - - - " );
        }

    }

}
